package gr.barbarosa.sshRemote.sdManipulation;

import android.os.Environment;

import java.io.File;

import gr.barbarosa.sshRemote.constants.constants;

/**
 * Created by ilias.karditsis on 12/5/2014.
 * Class Creating App folders for the first run
 */
public class folderManipulation {


    public void createMainAppFolder() {
        File directory = new File(Environment.getExternalStorageDirectory() + File.separator + constants.mainAppFolderName);
        if (directory.exists()) {
            return;
        } else {
            directory.mkdirs();
        }

    }


    public void createConnectionsFolder() {
        File directory = new File(Environment.getExternalStorageDirectory() + File.separator + constants.mainAppFolderName + File.separator + constants.connectionsAppFolder);
        if (directory.exists()) {
            return;
        } else {
            directory.mkdirs();
        }
    }

    public void createCommandsFolder() {
        File directory = new File(Environment.getExternalStorageDirectory() + File.separator + constants.mainAppFolderName + File.separator + constants.commandsAppFolder);
        if (directory.exists()) {
            return;
        } else {
            directory.mkdirs();
        }
    }

    public void createIconsFolder() {
        File directory = new File(Environment.getExternalStorageDirectory() + File.separator + constants.mainAppFolderName + File.separator + constants.iconsAppFolder);
        if (directory.exists()) {
            return;
        } else {
            directory.mkdirs();
        }
    }


    //methods returning folder names


    public static File getConnectionsFolder() {
        File directory = new File(Environment.getExternalStorageDirectory() + File.separator + constants.mainAppFolderName + File.separator + constants.connectionsAppFolder);
        return directory;
    }


}
